package com.ican.study2.web.controller.user;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ican.study2.biz.demo.domain.system.user.User;
import com.ican.study2.biz.demo.service.system.user.UserService;


@Controller
@RequestMapping("/user/user")
public class UserController {
    
    private UserService userService;
    
    @RequestMapping("login")
    public String login(User user, ModelMap modelMap){
        userService.addUser(user);
        modelMap.put("user", user);
        return "/demo/login";
    }

    @Resource
    public void setUserService(UserService userService) {
        this.userService = userService;
    }
}
